package com.legsem.voltdb.test.server;

import org.voltdb.ProcInfo;
import org.voltdb.SQLStmt;
import org.voltdb.VoltProcedure;
import org.voltdb.VoltTable;

@ProcInfo(partitionInfo = "MASTERDOCS.USER_LOGIN: 2", singlePartition = true)
public class Select extends VoltProcedure {

    public final SQLStmt sql = new SQLStmt(
            "SELECT MD, MD_SIZE FROM MASTERDOCS "
                    + " WHERE APP_NAME = ? AND SOURCE_NAME = ? AND USER_LOGIN = ?;");

    public VoltTable[] run(String app_name, String source_name,
            String user_login) throws VoltAbortException {
        voltQueueSQL(sql, app_name, source_name, user_login);
        return voltExecuteSQL();
    }
}
